<template>
	<view class="content">
		<z-paging ref="paging" v-model="list" @query="queryList">
			<view v-for="(m,i) in list" :key="i" class="xy-mt-5 xy-flex-center xy-color-acd xy-pb-10 xy-border-red" style="display: flex;padding: 30rpx;" @click="updateUserId(i)">
				<!-- <image
				:src="imgs"
				mode="aspectFill"
				class="xy-bg-orange xy-w-full xy-h-30"
				/> -->
				{{ m }}
			</view>
		</z-paging>
	</view>
</template>

<script>
import {mapState,mapGetters,mapMutations} from 'vuex'
	export default {
		computed: {
			...mapState('xy_user',['userInfo']),
			...mapGetters('xy_user',['userInfo']),
		},
		data() {
			return {
				list: [],
				imgs: this.$assets.url,
			}
		},
		onLoad() {

		},
		methods: {
			...mapMutations('xy_user',['updateUserInfo','removeUserInfo']),
			queryList(pageNo,pageSize){
				setTimeout(()=>{
					this.$refs.paging.complete([1,2,3,4,5,6,7,8,9,10])
				},2000)
			},
			updateUserId(i) {
				let userInfo = {
					userId:i
				}
				console.log('userInfo',this.userInfo);
				console.log('userId-old',this.userInfo.userId);
				this.updateUserInfo(userInfo)
				console.log('userInfo',this.userInfo);
				console.log('userId-new',this.userInfo.userId);
			}
		}
	}
</script>

<style>
	
</style>
